<template>
  <div class="statisticsWrap">
    <!-- 上半部分 -->
    <div class="statistics-up">
      <!-- 出勤统计 -->
      <div class="part-3">
        <!-- 出勤chart ref="dutyChart" -->
        <div class="dutyChart">
          <single-pie :bar-data="dutyData" pie-name="缺勤统计" class-name="dutyChart" />
        </div>
        <div class="box-tit">缺勤员工</div>
        <div class="duty-list">
          <div class="duty-ul">
            <a href="">
              <img :src="require('@/assets/img/img1.png')" />
              <span>夏雪峰</span>
              <span>INSTTT0007</span>
              <span>销售部</span>
            </a>
            <a href="">
              <img :src="require('@/assets/img/img1.png')" />
              <span>夏雪峰</span>
              <span>INSTTT0007</span>
              <span>销售部</span>
            </a>
            <a href="">
              <img :src="require('@/assets/img/img1.png')" />
              <span>夏雪峰</span>
              <span>INSTTT0007</span>
              <span>销售部</span>
            </a>
            <a href="">
              <img :src="require('@/assets/img/img1.png')" />
              <span>夏雪峰</span>
              <span>INSTTT0007</span>
              <span>销售部</span>
            </a>
            <a href="">
              <img :src="require('@/assets/img/img1.png')" />
              <span>夏雪峰</span>
              <span>INSTTT0007</span>
              <span>销售部</span>
            </a>
            <a href="">
              <img :src="require('@/assets/img/img1.png')" />
              <span>夏雪峰</span>
              <span>INSTTT0007</span>
              <span>销售部</span>
            </a>
            <a href="">
              <img :src="require('@/assets/img/img1.png')" />
              <span>夏雪峰</span>
              <span>INSTTT0007</span>
              <span>销售部</span>
            </a>
          </div>
        </div>
      </div>
      <!-- 产品统计 -->
      <div class="part-5">
        <single-bar :bar-data="productData" pie-name="产品统计" class-name="anthorChart" />
      </div>
      <!-- 优良等级统计 -->
      <div class="part-3">
        <div class="finebox">
          <single-pie :bar-data="fineData" pie-name="优良等级" class-name="fineChart" />
        </div>
      </div>
    </div>
    <!-- 下半部分 -->
    <div class="statistics-down">
      <div class="down-tit">产量统计</div>
      <div class="downList">
        <div class="yield-box">
          <single-bar :bar-data="productData" pie-name="产线A" class-name="product-a" />
        </div>
        <div class="yield-box">
          <single-bar :bar-data="productData" pie-name="产线A" class-name="product-b" />
        </div>
        <div class="yield-box">
          <single-bar :bar-data="productData" pie-name="产线A" class-name="product-c" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import singlePie from '@/components/aizChart/singlePie'
  import singleBar from '@/components/aizChart/singleBar'

  export default {
    components: {
      singlePie,
      singleBar,
    },
    data() {
      return {
        dutyData: [],
        productData: [],
        fineData: [],
      }
    },
    mounted() {
      this.getData()
    },
    created() {},
    methods: {
      getData() {
        this.dutyData = [
          { value: 300, name: '领导1' },
          { value: 1200, name: '普通工人2' },
          { value: 650, name: '外聘3' },
        ]
        this.fineData = [
          { value: 300, name: '领导1' },
          { value: 1200, name: '普通工人2' },
        ]
        this.productData = [
          { value: 300, name: '周一' },
          { value: 653, name: 'Tues' },
          { value: 1000, name: 'Wed' },
          { value: 910, name: 'Thu' },
          { value: 780, name: 'Far' },
          { value: 1350, name: 'Sat' },
          { value: 1350, name: 'Sun' },
        ]
      },
    },
  }
</script>

<style lang="scss">
  .statisticsWrap {
    width: 100%;
    height: 100%;
    min-width: 1220px;
    min-height: 768px;
    background: #f3f4f8;
    box-sizing: border-box;
  }

  .statistics-up {
    display: flex;
    width: 100%;
    height: 50%;

    .finebox {
      width: 100%;
      height: 100%;
    }

    .dutyChart {
      height: 45%;
    }

    .duty-list {
      width: 100%;
      height: 50%;

      .duty-ul {
        width: 100%;

        a {
          display: flex;
          float: left;
          width: 100%;
          height: 22px;
          margin: 4px 0;
          font-size: 13px;
          line-height: 22px;
          color: #999;
          justify-content: space-between;

          img {
            width: 18px;
            height: 18px;
          }
        }

        a:hover {
          color: #666;
          // font-weight: 700;
        }
      }
    }
  }

  .statistics-down {
    width: 100%;
    height: 48%;
    padding: 15px;
    margin-top: 1%;
    overflow: hidden;
    background: #fff;
    border-radius: 4px;
    box-sizing: border-box;

    .down-tit {
      width: 100%;
      height: 45px;
      font-size: 18px;
      font-weight: 700;
      line-height: 45px;
      text-align: left;
    }

    .downList {
      display: flex;
      width: 100%;
      height: calc(100% - 45px);
      justify-content: space-between;

      .yield-box {
        width: 32.5%;
        height: 100%;
      }
    }
  }

  /* public 公共部分 */
  .box-tit {
    width: 100%;
    height: 5%;
    font-size: 16px;
    font-weight: 700;
    line-height: 100%;
    text-align: left;
  }

  .part-3 {
    width: 24.5%;
    height: 100%;
    padding: 10px;
    overflow: hidden;
    background: #fff;
    border-radius: 4px;
    box-sizing: border-box;
  }

  .part-5 {
    width: 49%;
    height: 100%;
    padding: 10px;
    margin: 0 1%;
    background: #fff;
    border-radius: 4px;
    box-sizing: border-box;
  }
</style>
